Accurate accounting for credit scheduler
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Aug 2009 14:36:37 +0000 (15:36 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Aug 2009 14:36:37 +0000 (15:36 +0100)
commit78c9b2a64b38ee72cc4d3ea9e93a1a5d224ed822
tree4c32a978f0ab8bd88545d4c5b6f1e503f9c46024
parentc4651bd31d61b7173003c2e3a3fab5470bfeb847
Accurate accounting for credit scheduler

Rather than debit a full 10ms of credit on a scheduler tick
(probabilistic), debit credits accurately based on time stamps.

The main problem this is meant to address is an attack on the
scheduler that allows a rogue guest to avoid ever being debited
credits.  The basic idea is that the rogue process checks time (using
rdtsc) periodically, and yields after 9.5ms.  Using this technique, a
guest can "steal" 95% of the cpu.  This is particularly an issue in
cloud environments.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/sched_credit.c